package com.woniuxy.stage3demo.mapper.gy;

import com.woniuxy.stage3demo.bean.gy.PrRepaymentInfoBean;
import com.woniuxy.stage3demo.bean.gy.UserDemo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2020/12/14 9:31
 */
@Mapper
public interface OverduePrRepaymentInfoMapper {
    //查询提前还款明细表
    public List<PrRepaymentInfoBean> findAll(@Param("u") UserDemo userDemo);


    //查询本月提前还款的人数
    @ResultType(int.class)
    @Select("select count(id) from pr_repayment_info where deduct=1 and " +
            "date_format(create_time,'%Y%m')=date_format(curdate(),'%Y%m')")
    public int findCountMonth();


    //查询本年提前还款的人数
    @ResultType(int.class)
    @Select("select count(id) from pr_repayment_info where deduct=1 and " +
            "YEAR(create_time)=YEAR(NOW())")
    public int findCountYear();

    //查询本月提前还款的金额
    public List<Integer> findMoneyMonth();

    //查询本年提前还款的金额
    public List<Integer> findMoneyYear();
}
